class Restaurant():
    def __init__(self, name, cuisine_type):
        self.restaurant_name = name
        self.restaurant_cuisine_type = cuisine_type
        self.number_served = 0

    def describe_restaurant(self):
        print(f"This is {self.restaurant_name} Restaurant, "
              f"we make some {self.restaurant_cuisine_type} cuisine food.")

    def open_restaurant(self):
        print(f"{self.restaurant_name} Restaurant is opening!")
    # 设置就餐人数
    def set_number_served(self, num):
        self.number_served = num 
    # 递增就餐人数
    def increment_number_served(self, num):
        self.number_served += num     

class User():
    def __init__(self, first_name, last_name, hometown):
        self.first_name = first_name
        self.last_name = last_name
        self.hometown = hometown
        self.login_attempts = 0
    def describe_user(self):
        print(f"My name is {self.first_name}{self.last_name}, I'm from {self.hometown}.")
    def greet_user(self):
        print("hello every one!")
    def increment_login_attempts(self):
        self.login_attempts += 1
    def reset_login_attempts(self):
        self.login_attempts = 0

spring = Restaurant("Smile spring", "Chinese")
print(f"spring num: {spring.number_served}")
spring.set_number_served(20)
print(f"spring num: {spring.number_served}")
spring.increment_number_served(5)
print(f"spring num: {spring.number_served}")

person = User("xiao", "jun", "shanghai")
print(f"person: {person.login_attempts}")
for i in range(0,10):
    person.increment_login_attempts()
print(f"persopn: {person.login_attempts}")

person.reset_login_attempts()
print(f"persopn: {person.login_attempts}")
